<?php
header("content-type:text/html;charset=utf-8");
include("../config.php");
$domain=$_REQUEST["domain"];//社区域名
$api_token=$_REQUEST["api_token"];//用户的TokenID
$key=$_REQUEST["key"];//用户的密匙
$time=strtotime(date("YmdHis"));//时间戳
$id=$_REQUEST["id"];//订单号
$ids=$_REQUEST["ids"];//订单号列表，用于批量查询，多个用,隔开
$hh=$_REQUEST['hh']?:"\n";//换行符号(默认\n)
function curl($url,$post)
{
$curl=curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_POSTFIELDS,$post);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
return curl_exec($curl);
curl_close($curl);
}
//分割
function getsign($param,$key)
{
$signpars="";
ksort($param);
foreach($param as $k=>$v)
{
if("sign"!=$k&&""!=$v)
{
$signpars.="".$k."=".$v."&";
}
}
$signpars=trim($signpars,"&");
$signpars.=$key;
return md5($signpars);
}
$params=["api_token"=>$api_token,"timestamp"=>$time,"id"=>$id,"ids"=>$ids];
$sign=getsign($params,$key);
//分割
$url="".$domain."/api/order/query";
$post="api_token=".$api_token."&timestamp=".$time."&sign=".$sign."&id=".$id."&sid=".$sid."";
$data=curl($url,$post);
$json=json_decode($data,true);
if($json["status"]=="0")
{
echo "".$web["ming"]."API亿乐社区订单查询".$hh."";
echo "━━━━━━━━━".$hh."";
echo "[查询账号]：".$json["data"]["value1"]."".$hh."";
echo "[下单数量]：".$json["data"]["num"]."个".$hh."";
echo "[初始数量]：".$json["data"]["start_num"]."个".$hh."";
echo "[现在数量]：".$json["data"]["now_num"]."个".$hh."";
echo "[退款数量]：".$json["data"]["tnum"]."点".$hh."";
echo "[下单时间]：".$json["data"]["created_at"]."".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}else{
echo "".$web["ming"]."API亿乐社区订单查询".$hh."";
echo "━━━━━━━━━".$hh."";
echo "".$json["message"]."".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}
?>